require('./service/index')
const Koa = require('koa');
const cors = require('koa2-cors');
const bodyParser = require('koa-bodyparser');
const koaBody = require('koa-body');
const router = require('./router/index') // koa 路由中间件
const authMiddle = require('./middle/auth');
const app = new Koa();
app.use(cors());
app.use(koaBody({
    multipart: true,
    formidable: {
        maxFileSize: 10 * 1024 * 1024 // 设置上传文件大小最大限制，默认2M
    }
}));
app.use(authMiddle());
app.use(bodyParser());
app.use(router.routes());
app.listen(3333, () => {
    console.log('This server is running at http://localhost:' + 3333)
})